<template>
  <div class="box">
    <el-carousel trigger="click" :interval="4000" type="card" height="170px">
      <el-carousel-item v-for="item in datalist" :key="item.index">
        <img :src="item.pic" />
        <div class="parent">
          <!-- <div class="zj">{{item.typeTitle}}</div> -->
        </div>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<style scoped>
.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  line-height: 200px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
.box {
  position: relative;
  top: 100px;
  left: 120px;
}
img {
  width: 100%;
}
</style>
<script>
import axios from "axios";
import { API } from "../../../common/constant";
export default {
  data() {
    return {
      datalist: [],
    };
  },
  mounted() {
    axios({
      url: `${API}/dj/banner`,
      method: "get",
    }).then((res) => {
      console.log(res);
      this.banners = res.data.banners;
    });
  },
};
</script>
